package cn.xxy.result;

import cn.xxy.ResultSetHandler;
import cn.xxy.RowProcessor;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Map;

/**
 * @author xxy
 * @date 2021/7/28
 * 将ResultSet转换为Map
 */
public class MapHandler implements ResultSetHandler<Map<String, Object>> {

    @Override
    public Map<String, Object> handle(ResultSet rs) throws SQLException {
        return rs.next() ? RowProcessor.toMap(rs) : null;
    }
}
